package reflect;

import reflect.annotations.AutoRunClass;

import java.lang.reflect.Method;

public class ReflectDemo10
{
    public static void main(String[] args) throws Exception
    {
        Class aClass = Class.forName("reflect.Person");
        // 判断 Peron类是否被 AutoRunClass 标注了
        boolean mark = aClass.isAnnotationPresent(AutoRunClass.class);
        System.out.println(mark);
        Object o = aClass.newInstance();
        Method say = aClass.getMethod("say");
        say.invoke(o);
    }
}
